package com.emagic.manage.data.network;

import com.emagic.manage.data.entities.response.Empty;
import com.emagic.manage.data.entities.response.OutOffResponse;
import com.emagic.manage.data.entities.response.RoomsResponse;
import com.emagic.manage.data.entities.response.UserResponse;

import retrofit2.http.GET;
import retrofit2.http.Path;
import rx.Observable;

/**
 * 定义Restful风格api接口,用于从网络中检索数据。
 *
 * @author baoy
 * @version 1.0
 *          Create by 15/12/10 下午6:53
 */
@SuppressWarnings("unchecked")
public interface NetworkApi {

    String JSON_DATA = "jsonData";

    /**
     * 通过此接口获取手机验证码（验证码统一为4位）
     * <p>>
     * rid   房产唯一标识
     * phone 手机号码
     * type  类型
     */
    @GET("checkuserpwd/account/{accountValue}/userpwd/{pwdValue}")
    Observable<UserResponse> loginapi(@Path("accountValue") String account, @Path("pwdValue") String pwd);

    @GET("getUserAllRoomByUserid/userid/{useridValue}")
    Observable<RoomsResponse> getallroom(@Path("useridValue") String userid);

    @GET("logOut/userid/{useridValue}/sessionid/{sessionidValue}")
    Observable<OutOffResponse> logOut(@Path("useridValue") String userid, @Path("sessionidValue") String sessionid);

    @GET("getroom/serial/{serialValue}")
    Observable<OutOffResponse> getroom(@Path("serialValue") String serial);

    @GET("sendgift/serial/{serialValue}/sendid/{sendidValue}/sendname/{sendnameValue}/receivearr/{receivearrValue}")
    Observable<Empty> sendgift(@Path("serialValue") String serial, @Path("sendidValue") String sendid,
                               @Path("sendnameValue") String sendname, @Path("receivearrValue") Object object);
}